<?php
namespace app\tools\logic;
use think\facade\Db;

class DictLogic{
	static function getData(){
		$dict_type = input('dict_type', '');
		if(!$dict_type){
			return ['code'=>138];
		}

		$list = Db::name('dict_data')
				->field('name as label, value')
				->where('dict_type', $dict_type)
				->where('status', 1)
				->order('sort asc, id asc')
				->select();
		return ['code'=>0,'data'=>$list];
	}
}